﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Service.Core;
using Service.Logic;

namespace Service
{
    class ServiceMain
    {
        static void Main(string[] args)
        {
            ServNet servNet = new ServNet();
            servNet.Start("127.0.0.1",1234);
            //DataMgr dataMgr = new DataMgr();
            ////region
            //bool ret = dataMgr.Register("w","123");
            //if (ret) Console.WriteLine("R success");
            //else Console.WriteLine("R fail");

            ////create player
            //ret = dataMgr.CreatePlayer("w");
            //if (ret) Console.WriteLine("C success");
            //else Console.WriteLine("C fail");

            ////get player data
            //PlayerData playerData = dataMgr.GetPlayerData("w");
            //if (playerData != null) Console.WriteLine("G success"+playerData.score);
            //else Console.WriteLine("G fail");

            ////update player data
            //playerData.score += 4;
            ////save
            //Player p = new Player();
            //p.id = "w";
            //p.data = playerData;
            //dataMgr.SavePlayer(p);
            ////read data again
            //playerData = dataMgr.GetPlayerData("w");
            //if (playerData != null) Console.WriteLine("G success" + playerData.score);
            //else Console.WriteLine("G fail");

            Console.ReadKey();
        }
    }
}
